package com.blood.core.resp;

import lombok.Getter;


/**
 * @author yelong
 * @version 1.0
 * @date 2020/8/12 11:35
 * @description 系统操作枚举
 */
@Getter
public enum GlobalResultStatus implements ResultStatus {

    // 操作成功的结果
    SUCCESS(true, "0000", "成功"),

    // 操作失败的结果
    FAIL("0001", "系统繁忙,请稍后再试!"),

    ERROR_PARAM("0002", "参数校验失败"),

    ILLEGAL_REQUEST("0003", "非法请求"),

    NOT_LOGIN("0004", "未登录或登录token过期"),

//    TOKEN_EXPIRED("0005","访问令牌过期"),

    TOKEN_INVALID("0006", "无效的token"),

    SING_ERROR("0007", "签名失败"),

    TIMEOUT("1111", "超时"),

    SYS_ERROR("9999", "系统错误"),

    UNAUTHORIZED("48002", "API接口无权限调用"),

    REPEAT_LOGIN("48003", "用户已在其它地方登录"),

    NOT_USER("48004", "用户不存在"),
    ;

    private final boolean success;
    private final String code;
    private final String message;

    GlobalResultStatus(boolean success, String code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    GlobalResultStatus(String code, String message) {
        this(false, code, message);
    }
}
